package com.thinkgem.jeesite.modules.reader.entity;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.google.common.collect.Lists;
import com.thinkgem.jeesite.common.persistence.DataEntity;
import com.thinkgem.jeesite.common.utils.excel.annotation.ExcelField;
import com.thinkgem.jeesite.modules.bookset.entity.BkPlace;

import java.util.List;

/**
 * 角色Entity
 * Created by liu_pc on 2015-10-29.
 */
public class ReaderRoler extends DataEntity<ReaderRoler> {

    private String rdRoleId;//读者角色

    private String roleName; //角色名称

    private String role;//具体角色权限（100是老师，200是学生）

    private String rdCanBorrowDays;//可借天数

    private String rdCanBorrowdBooks;//可借册数

    private String rdContinueBorrowCount;//可续借次数

    private String rdContinueBorrowDays;//可续借天数

    private String rdPreBorrowDays;//可预借天数（本次系统不考虑，只为后期扩展）

    private String rdPreBorrowBooks;//可预借册数（本次系统不考虑，只为后期扩展）
    private String minRetdays;//允许最小还书间隔天数
    private String remarks;//备注
    private List<ReaderRolePlace> readerRolePlaceList;
    private List<BkPlace> bkPlaceList = Lists.newArrayList(); // 支持流通的书库

    @ExcelField(title="ID", type=1, align=2, sort=1)
    public String getId() {
        return id;
    }

    public String getRdRoleId() {
        return rdRoleId;
    }

    public void setRdRoleId(String rdRoleId) {
        this.rdRoleId = rdRoleId;
    }

    public String getRoleName() {
        return roleName;
    }

    public void setRoleName(String roleName) {
        this.roleName = roleName;
    }

    public String getRole() {
        return role;
    }

    public void setRole(String role) {
        this.role = role;
    }

    public String getRdCanBorrowDays() {
        return rdCanBorrowDays;
    }

    public void setRdCanBorrowDays(String rdCanBorrowDays) {
        this.rdCanBorrowDays = rdCanBorrowDays;
    }

    public String getRdCanBorrowdBooks() {
        return rdCanBorrowdBooks;
    }

    public void setRdCanBorrowdBooks(String rdCanBorrowdBooks) {
        this.rdCanBorrowdBooks = rdCanBorrowdBooks;
    }

    public String getRdContinueBorrowCount() {
        return rdContinueBorrowCount;
    }

    public void setRdContinueBorrowCount(String rdContinueBorrowCount) {
        this.rdContinueBorrowCount = rdContinueBorrowCount;
    }

    public String getRdContinueBorrowDays() {
        return rdContinueBorrowDays;
    }

    public void setRdContinueBorrowDays(String rdContinueBorrowDays) {
        this.rdContinueBorrowDays = rdContinueBorrowDays;
    }

    public String getRdPreBorrowDays() {
        return rdPreBorrowDays;
    }

    public void setRdPreBorrowDays(String rdPreBorrowDays) {
        this.rdPreBorrowDays = rdPreBorrowDays;
    }

    public String getRdPreBorrowBooks() {
        return rdPreBorrowBooks;
    }

    public void setRdPreBorrowBooks(String rdPreBorrowBooks) {
        this.rdPreBorrowBooks = rdPreBorrowBooks;
    }

    public String getReMarks() {
        return remarks;
    }

    public void setReMarks(String reMarks) {
        this.remarks = reMarks;
    }

    public List<BkPlace> getBkPlaceList() {
        return bkPlaceList;
    }
    public List<ReaderRolePlace> getReaderRolePlaceList() {
        return readerRolePlaceList;
    }

    public void setReaderRolePlaceList(List<ReaderRolePlace> readerRolePlaceList) {
        this.readerRolePlaceList = readerRolePlaceList;
    }
    public void setBkPlaceList(List<BkPlace> bkPlaceList) {
        this.bkPlaceList = bkPlaceList;
    }

    public String getMinRetdays() {
        return minRetdays;
    }

    public void setMinRetdays(String minRetdays) {
        this.minRetdays = minRetdays;
    }

    @JsonIgnore
    public List<String> getBkPlaceIdList() {
        List<String> bkPlaceIdList = Lists.newArrayList();
        for (BkPlace bkPlace : bkPlaceList) {
            bkPlaceIdList.add(bkPlace.getPlaceid());
        }
        return bkPlaceIdList;
    }

    public void setBkPlaceIdList(List<String> bkPlaceIdList) {
        bkPlaceList = Lists.newArrayList();
        for (String placeId : bkPlaceIdList) {
            BkPlace bkPlace = new BkPlace();
            bkPlace.setPlaceid(placeId);
            bkPlaceList.add(bkPlace);
        }
    }
    @Override
    public String getRemarks() {
        return remarks;
    }

    @Override
    public void setRemarks(String remarks) {
        this.remarks = remarks;
    }

    public ReaderRoler(String rdRoleId,String roleName){
        this.rdRoleId = rdRoleId;
        this.roleName = roleName;
    }
    public ReaderRoler(){

    }
    public ReaderRoler(String rdRoleId, String roleName, String role, String rdCanBorrowDays, String rdCanBorrowdBooks, String rdContinueBorrowCount, String rdContinueBorrowDays, String rdPreBorrowDays, String rdPreBorrowBooks, String reMarks,String minRetdays) {
        this.rdRoleId = rdRoleId;
        this.roleName = roleName;
        this.role = role;
        this.rdCanBorrowDays = rdCanBorrowDays;
        this.rdCanBorrowdBooks = rdCanBorrowdBooks;
        this.rdContinueBorrowCount = rdContinueBorrowCount;
        this.rdContinueBorrowDays = rdContinueBorrowDays;
        this.rdPreBorrowDays = rdPreBorrowDays;
        this.rdPreBorrowBooks = rdPreBorrowBooks;
        this.minRetdays = minRetdays;
        this.remarks = reMarks;
    }
}
